package cn.edu.scau.cmi.huangzhiyuan.singleton;

/**
 * 总统类，
 * 用于单利模式
 */
public class President {
	private static String name = "毛泽东";
	private static President president = null;
	
	// 私有化无参构造方法
	private President() {
	}
	
	public static President getInstance() {
		if(president == null) {
			president = new President();
		}
		
		return president;
	}

	public static String getName() {
		return name;
	}

	public static void setName(String name) {
		President.name = name;
	}
	
}
